package com.Qinmeiwei.web.pojo.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the ip_record table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="ip_record"
 */

public abstract class BaseIpRecord  implements Serializable {

	public static String REF = "IpRecord";
	public static String PROP_IP = "ip";
	public static String PROP_CREATE_TIME = "createTime";
	public static String PROP_ID = "id";
	public static String PROP_USER_ID = "userId";
	public static String PROP_EVENT_CODE = "eventCode";


	// constructors
	public BaseIpRecord () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseIpRecord (com.Qinmeiwei.web.pojo.IpRecordPK id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseIpRecord (
		com.Qinmeiwei.web.pojo.IpRecordPK id,
		java.lang.String userId,
		java.lang.Integer ip,
		java.util.Date createTime) {

		this.setId(id);
		this.setUserId(userId);
		this.setIp(ip);
		this.setCreateTime(createTime);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private com.Qinmeiwei.web.pojo.IpRecordPK id;

	// fields
	private java.lang.String eventCode;
	private java.lang.String userId;
	private java.lang.Integer ip;
	private java.util.Date createTime;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     */
	public com.Qinmeiwei.web.pojo.IpRecordPK getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (com.Qinmeiwei.web.pojo.IpRecordPK id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: event_code
	 */
	public java.lang.String getEventCode () {
		return eventCode;
	}

	/**
	 * Set the value related to the column: event_code
	 * @param eventCode the event_code value
	 */
	public void setEventCode (java.lang.String eventCode) {
		this.eventCode = eventCode;
	}



	/**
	 * Return the value associated with the column: user_id
	 */
	public java.lang.String getUserId () {
		return userId;
	}

	/**
	 * Set the value related to the column: user_id
	 * @param userId the user_id value
	 */
	public void setUserId (java.lang.String userId) {
		this.userId = userId;
	}



	/**
	 * Return the value associated with the column: ip
	 */
	public java.lang.Integer getIp () {
		return ip;
	}

	/**
	 * Set the value related to the column: ip
	 * @param ip the ip value
	 */
	public void setIp (java.lang.Integer ip) {
		this.ip = ip;
	}



	/**
	 * Return the value associated with the column: create_time
	 */
	public java.util.Date getCreateTime () {
		return createTime;
	}

	/**
	 * Set the value related to the column: create_time
	 * @param createTime the create_time value
	 */
	public void setCreateTime (java.util.Date createTime) {
		this.createTime = createTime;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.Qinmeiwei.web.pojo.IpRecord)) return false;
		else {
			com.Qinmeiwei.web.pojo.IpRecord ipRecord = (com.Qinmeiwei.web.pojo.IpRecord) obj;
			if (null == this.getId() || null == ipRecord.getId()) return false;
			else return (this.getId().equals(ipRecord.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}